<?php

if (isset($_GET ['a'])) {
    $action = $_GET ['a'];
}

if ($action == 'nous') {
    $smarty->display("infos.tpl");
} elseif ($action == 'mentions') {
    $smarty->display("mentionsLegales.tpl");
} elseif ($action == 'conditions') {
    $smarty->display("conditionsGenerales.tpl");

    // par défaut on affiche la page contact
} else {
    if (isset($_POST['a'])) {
        $nom = $_POST['nom'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        
        $flash['type'] = "infos";
        $flash['message'] = "Votre message a été transmis !";
        $smarty->assign("flash", $flash);
        // Envoi du mail
//        mail("contact@nfe102.com", "contact", $message);
    }
    $smarty->display("contact.tpl");
}